<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        arr=[123,"ass","bbb",234,"sdjaa","fdsfff"]
        let arr1=arr.slice(2,4)
        console.log(arr1)
        let arr2=[1,2,3,4,5,6]
        let arr3=arr2.reduce((pre,cur)=>{
            console.log(pre)
            console.log(cur)
            return pre+cur
        })
        console.log(arr3)
        let arr4=arr2.reduce((pre,cur)=>{
            return pre-cur
        },0)
        console.log(arr4)
        let arr5=["aa","fds","fsfsf",123,3131,22]
        for(item of arr5){
            console.log(item)
        }
        for(index in arr5){
            console.log(index)
            console.log(arr5[index])
        }
        let obj={
            name:"zhangsan",
            age:20,
            gender:"male"
        }
        console.log(obj.name)
        console.log(obj["name"])

    </script>
</body>
</html>